package com.dalin.framework.common.clazz;

import java.util.List;

import com.dalin.framework.common.clazz.ImportList;
import com.dalin.framework.common.utils.StringUtils;
import com.dalin.framework.common.PropertyConst;

/*****************************************************************************
 * @content: 接口定义                                                        *
 * @author : 那建林                                                          *
 * @crtDate: 2009-10-04                                                     *
 * @version: 1.01                                                           *
 ****************************************************************************/
public class Interfazz{	
	private String packageName; // 类包
	private ImportList importList; // 引入包
	private String interfaceName; // 接口名
	private String extendsInterfaceName; // 继承接口
	private List<Method> methodList; // 类方法

	public String toString() {
		StringBuffer sb = new StringBuffer();
		// 包名
		if (!StringUtils.isBlank(packageName)) {
			sb.append(PropertyConst.PACKAGE_STR).append(PropertyConst.SPACE).append(
					packageName).append(PropertyConst.SEMICOLON).append(
					PropertyConst.LINE_SEPARATOR).append(PropertyConst.LINE_SEPARATOR);
		}
		// 引用
		if (importList != null) {
			sb.append(importList);
		}
		// 接口类注释
		sb.append(Note.getClassNote());
		// public class className
		sb.append(PropertyConst.PUBLIC_STR).append(PropertyConst.SPACE).append(
				PropertyConst.INTERFACE_STR).append(PropertyConst.SPACE)
				.append(interfaceName);
		// 是否有继承
		if (!StringUtils.isBlank(extendsInterfaceName)) {
			sb.append(PropertyConst.SPACE).append(PropertyConst.EXTENDS_STR).append(
					PropertyConst.SPACE).append(extendsInterfaceName);
		}
		sb.append(PropertyConst.SPACE).append(PropertyConst.LEFT_BRACE)
			.append(PropertyConst.LINE_SEPARATOR);
		// 公有方法;
		if (!StringUtils.isBlank(methodList)) {
			for (int i = 0; i < methodList.size(); i++) {
				sb.append(methodList.get(i).toAbstractMethodString());
			}
		}
		sb.append(PropertyConst.RIGHT_BRACE);
		return sb.toString();
	}

	
	
	
	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}
	public ImportList getImportList() {
		return importList;
	}
	public void setImportList(ImportList importList) {
		this.importList = importList;
	}
	public String getInterfaceName() {
		return interfaceName;
	}

	public void setInterfaceName(String interfaceName) {
		this.interfaceName = interfaceName;
	}

	public String getExtendsInterfaceName() {
		return extendsInterfaceName;
	}

	public void setExtendsInterfaceName(String extendsInterfaceName) {
		this.extendsInterfaceName = extendsInterfaceName;
	}

	public List<Method> getMethodList() {
		return methodList;
	}

	public void setMethodList(List<Method> methodList) {
		this.methodList = methodList;
	}
}
